<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>在组件上使用v-for</title>
    <script src="../../utils/vue.js"></script>
</head>
<body>
    <ul id="app">
        <!-- 当v-for用于模板中时，不会渲染模板，而是循环渲染模板内部的内容 -->
        <template v-for="item in items">
            <li>{{ item.msg }}</li>
            <li class="divider" role="presentation">呵呵哒</li>
        </template>
    </ul>

    <script>
        var app = new Vue({
            el: "#app",
            data: {
                // 对象的属性名若包含特殊字符，需要引号引起来，属性值一定要用引号
                items: [
                    {msg: "hello"},
                    {msg: "world"},
                    {msg: "vue"}
                ]
            }
        });
    </script>
</body>
</html>